package com.zmx.user.entity;

import com.zmx.common.common.entitys.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;

/**
 * @author zhaomxr
 * 用户黑名单
 */
@Data
@Entity
@Table(name = "member_blacklist")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper=true)
@Inheritance(strategy = InheritanceType.JOINED)
@Where(clause = "dr = 0")
public class MemberBlacklist extends BaseEntity {

	/**
	 * 用户id
	 */
	@Column(name = "member_id")
	private Long memberId;

	/**
	 * 用户名
	 */
	@Column(name = "member_name")
	private String memberName;

	/**
	 * ip地址
	 */
	@Column(name = "ip")
	private String ip;

	/**
	 * 封禁开始时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "begin_time")
	private java.util.Date beginTime;

	/**
	 * 封禁结束时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "end_time")
	private java.util.Date endTime;

	/**
	 * 封禁原因
	 */
	@Column(name = "reason")
	private String reason;

	/**
	 * 封禁类型（10-全部封禁，20-禁止下单，30-禁止秒杀）
	 */
	@Column(name = "type")
	private Integer type;

	/**
	 * 是否解除（0-未解除，1-已解除）
	 */
	@Column(name = "is_relieve")
	private Integer isRelieve;
}
